﻿package 
{	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	
	import com.app.AppFacade;
	
	import com.app.view.manager.LayerManagerMediator;

	/**
	 * ...
	 * @author kevin
	 */
	
	[SWF(width = "760", height = "600")]
	public class Main extends Sprite
	{
		public function Main()
		{
			if (stage) 
				addToStageHandler();
			else
				addEventListener(Event.ADDED_TO_STAGE, addToStageHandler, false, 0, true);
		}
		
		private function addToStageHandler(e:Event = null):void 
		{
			if (e) e.currentTarget.removeEventListener(e.type, arguments.callee);

			var webs:Object = null;
			if (Loading.instance) webs = Loading.instance.webs;

			AppFacade.getInstance().startup([this, webs]);
		}
	}

}